package com.another.common

import com.alibaba.fastjson.JSON
import com.another.common.entity.TUser
import com.another.common.utils.common.EmptyUtil
import com.another.common.utils.result.Result
import java.sql.DriverManager.println

fun test(form: TUser, a: () -> Result): Result {
    if (EmptyUtil.isEmpty(form.userId)) {
        return Result.error("formId 不能为空")
    } else {
        return a()
    }
}

fun main() {

    var formModel = TUser()
    formModel?.userId = ""

    var result: Result = test(formModel) {
        println("成功了")
        Result.success("成功了  ")

    }

    println(JSON.toJSONString(result))
}